﻿using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;

namespace iRobotController
{
    public class BkgdColour : IValueConverter
    {
        private static readonly Brush WhiteBackground = Brushes.White;
        private static readonly Brush GreenBackground = Brushes.LightGreen;

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if ((bool)value)
                return GreenBackground;

            return (bool)value ? GreenBackground : WhiteBackground;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
